{extend name="layout" /}

{block name="breadcrumb"}
<h2>分配角色</h2>
<ol class="breadcrumb">
    <li><a href="{:url('index/index')}">首页</a></li>
    <li><a href="{:url('index')}">管理员列表</a></li>
    <li><strong>分配角色</strong></li>
</ol>
{/block}

{block name="main"}
<div class="ibox float-e-margins">
    <div class="ibox-title">
        <h5>分配角色</h5>
    </div>
    <div class="ibox-content">

        <form method="post" class="form-horizontal" onsubmit="return toSubmit('{:url("assignment")}')">

            <div class="form-group">
                <label class="col-sm-2 control-label">管理员</label>
                <div class="col-sm-6"><input type="text" class="form-control" value="{$model.user_name}" readonly /></div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">手机号码</label>
                <div class="col-sm-6"><input type="text" class="form-control" value="{$model.mobile}" readonly /></div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">角色</label>
                <div class="col-sm-6">
                    {foreach $role as $key=>$vo}
                    <div class="radio radio-success">
                        <input type="radio" name="role_id[]" id="{$vo.id}"
                               value="{$vo.id}" {$vo.active=='true' ? 'checked' : ''} />
                        <label for="{$vo.id}"> {$vo.name} </label>
                    </div>
                    {/foreach}
                </div>
            </div>

            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-2">
                    {if ( $model && $model.id > 0) }
                    <input type="hidden" name="user_id" value="{$model.id}">
                    {/if}

                    <button class="btn btn-primary" type="submit">提交</button>
                    <button class="btn btn-white" type="button"><a href="{:url('index')}">取消</a></button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
